public class Main {
	public static void main(String[] args) {
		String path = "D:\\MyRoom\\Study\\JavaUtils\\PackageRename\\src\\main\\java\\com\\component\\layout\\Lay.java";
		String prefix = "com.component";
		System.out.println(path.substring(path.lastIndexOf(prefix.replaceAll("\\.", "\\\\")),
				path.lastIndexOf("\\")).replaceAll("\\\\", "\\."));
	}
}
